import 'package:json_annotation/json_annotation.dart';
import 'package:casdon/modules/device/data/api/scan_result_data.dart';

part 'scan_model_api.g.dart';

@JsonSerializable()
class ScanModel {
  @JsonKey(name: 'code')
  final int code;

  @JsonKey(name: 'result')
  final ScanResultData? result;

  @JsonKey(name: 'message')
  final String? message;

  @JsonKey(name: 'requestId')
  final String? requestId;

  @JsonKey(name: 'success')
  final bool? success;

  factory ScanModel.fromJson(Map<String, dynamic> json) =>
      _$ScanModelFromJson(json);

  Map<String, dynamic> toJson() => _$ScanModelToJson(this);

  ScanModel({
    required this.code,
    this.result,
    this.message,
    this.requestId,
    required this.success,
  });
}

